package com.tianjian.myblog.web;

import com.tianjian.myblog.exception.NotFoundException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

    @GetMapping("/")
    public String index(){

       // int i = 9/0;
//        String blog = null;
//        if(blog == null) {
//            throw new NotFoundException("blog找不到");
//        }

        System.out.println("--------index 方法---------");
        return "index";
    }


    @GetMapping("/blog")
    public String blog(){

        // int i = 9/0;
//        String blog = null;
//        if(blog == null) {
//            throw new NotFoundException("blog找不到");
//        }

        System.out.println("--------index 方法---------");
        return "blog";
    }
}
